package com.qing.cheng.util;


import com.qing.cheng.entity.QcUser;

import javax.servlet.http.HttpServletRequest;

public class SessionUtil {

    public static Integer getUserId(HttpServletRequest request){
        QcUser qcUser = (QcUser) request.getSession().getAttribute("user");
        if (qcUser == null) {
            return 1;
        }
        return qcUser.getId();
    }
}
